From: Felix Fietkau Date: Thu, 2 Oct 2025 11:29:57 +0000 (+0200) Subject: wifi-scripts: retry setup of wireless devices that show up late X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=727d8b27ab94f8f9e3c75571e2a8c1322a7c28d9;p=openwrt%2Fopenwrt.git wifi-scripts: retry setup of wireless devices that show up late When a phy appears after setup has already been attempted, tell netifd to retry setup for all failed wireless devices. Signed-off-by: Felix Fietkau --- diff --git a/package/network/config/wifi-scripts/files/etc/hotplug.d/ieee80211/10-wifi-detect b/package/network/config/wifi-scripts/files/etc/hotplug.d/ieee80211/10-wifi-detect index b865552661..64eeb7235b 100644 --- a/package/network/config/wifi-scripts/files/etc/hotplug.d/ieee80211/10-wifi-detect +++ b/package/network/config/wifi-scripts/files/etc/hotplug.d/ieee80211/10-wifi-detect @@ -2,4 +2,5 @@ [ "${ACTION}" = "add" ] && { /sbin/wifi config + ubus call network.wireless retry } diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc index e982338737..cccb6c9c8c 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless-device.uc @@ -405,6 +405,19 @@ function start() this.setup(); } + +function retry_setup() +{ + if (this.delete) + return; + + if (this.state != "down" || !this.autostart) + return; + + this.start(); +} + + function stop() { this.dbg("stop, state=" + this.state); @@ -604,6 +617,7 @@ function dbg(msg) const wdev_proto = { update, destroy, + retry_setup, start, stop, setup, diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc index 500033be97..7c5913ac60 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless.uc @@ -446,6 +446,17 @@ const ubus_obj = { }); } }, + retry: { + args: wdev_args, + call: function(req) { + hostapd_update_mlo(); + + return wdev_call(req, (dev) => { + dev.retry_setup(); + return 0; + }); + } + }, reconf: { args: wdev_args, call: function(req) {